package cn.ctodb.mall.goods.service.mapper;

import cn.ctodb.mall.goods.domain.*;
import cn.ctodb.mall.goods.service.dto.BrandDTO;

import org.mapstruct.*;
import java.util.List;

/**
 * Mapper for the entity Brand and its DTO BrandDTO.
 */
@Mapper(componentModel = "spring", uses = {})
public interface BrandMapper {

    BrandDTO brandToBrandDTO(Brand brand);

    List<BrandDTO> brandsToBrandDTOs(List<Brand> brands);

    Brand brandDTOToBrand(BrandDTO brandDTO);

    List<Brand> brandDTOsToBrands(List<BrandDTO> brandDTOs);
    /**
     * generating the fromId for all mappers if the databaseType is sql, as the class has relationship to it might need it, instead of
     * creating a new attribute to know if the entity has any relationship from some other entity
     *
     * @param id id of the entity
     * @return the entity instance
     */
     
    default Brand brandFromId(Long id) {
        if (id == null) {
            return null;
        }
        Brand brand = new Brand();
        brand.setId(id);
        return brand;
    }
    

}
